package com.qf.utils;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class CookieUtils {
    public String getToken(HttpServletRequest request){
        Cookie[] cookies = request.getCookies();
        String token=null;
        for (Cookie cook: cookies  ) {
            if(cook.getName().equals("token")){
                token=cook.getValue();
            }
        }
        return token;
    }
}
